<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Disk Directory Viewer</title>
    <link href="./bootstrap.min.css" rel="stylesheet">
    <script src="./jquery-3.6.0.min.js"></script>
    <script src="./bootstrap.bundle.min.js"></script>
</head>
<body>
    <div class="container mt-5">
        <h1>D Drive Directory</h1>
        <ul id="directory-list" class="list-group mt-3"></ul>
    </div>
    <script>
        $(document).ready(function() {
            $.ajax({
                url: '/dirlist.py',
                type: 'GET',
                success: function(data) {
                    console.log(data);
                    var dirs = data; //JSON.parse(data);
                    dirs.forEach(function(dir) {
                        $('#directory-list').append('<li class="list-group-item">' + dir + '</li>');
                    });
                }
            });
        });

        /**
        window.addEventListener('load', function() {
            document.body.style.webkitUserSelect = 'auto'; // 允许 WebKit 浏览器复制
            document.body.style.mozUserSelect = 'auto';     // 允许 Firefox 复制
            document.body.style.msUserSelect = 'auto';      // 允许 IE/Edge 复制
        });
         */
    </script>
</body>
</html>